package com.cn.hangyun.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cn.hangyun.dao.Rt_currentspeed_controlMapper;
import com.cn.hangyun.dao.Rt_currentspeed_dataMapper;
import com.cn.hangyun.dao.Rt_currentspeed_transducerMapper;
import com.cn.hangyun.dao.Rt_waveheight_controlMapper;
import com.cn.hangyun.dao.Rt_waveheight_dataMapper;
import com.cn.hangyun.dao.Rt_waveheight_transducerMapper;
import com.cn.hangyun.model.Rt_currentspeed_control;
import com.cn.hangyun.model.Rt_currentspeed_transducer;
import com.cn.hangyun.model.Rt_waveheight_control;
import com.cn.hangyun.model.Rt_waveheight_transducer;
import com.cn.hangyun.service.IPoseService;

@Service("poseService")
public class PoseServiceImpl implements IPoseService {

	//波高
	@Autowired
	private Rt_waveheight_transducerMapper strTranMapper;
	
	@Autowired
	private Rt_waveheight_dataMapper strdataMapper;
	
	@Autowired
	private Rt_waveheight_controlMapper strcontrolMapper;
	
	//流速
	@Autowired
	private Rt_currentspeed_transducerMapper currentSpeedTranMapper;
	
	@Autowired
	private Rt_currentspeed_dataMapper currentSpeeddataMapper;
	
	@Autowired
	private Rt_currentspeed_controlMapper currentSpeedcontrolMapper;
	
	@Override
	public List<Rt_waveheight_transducer> getWaveHeightTransducer() {
		List<Rt_waveheight_transducer> list = strTranMapper.selectAll();
		return list;
	}

	@Override
	public List<String> getWaveHeightData(String controlId, Date start, Date end,String trans) {
		List<String> list = strdataMapper.selectData(controlId, start, end, trans);
		return list;
	}

	@Override
	public Rt_waveheight_control getWaveHeightControl(Date current) {
		Rt_waveheight_control rt=strcontrolMapper.selectLast(current);
		// TODO Auto-generated method stub
		return rt;
	}

	//取得流速传感器列表
	@Override
	public List<Rt_currentspeed_transducer> getCurrentSpeedTransducer() {
		// TODO Auto-generated method stub
		return currentSpeedTranMapper.selectAll();
	}

	@Override
	public Rt_currentspeed_control getCurrentSpeedControl(Date current) {
		// TODO Auto-generated method stub
		return currentSpeedcontrolMapper.selectLast(current);
	}

	@Override
	public List<String> getCurrentSpeedData(String controlId, Date start, Date end, String tranList) {
		List<String> list = currentSpeeddataMapper.selectData(controlId, start, end, tranList);
		return list;
	}

	


}
